<!DOCTYPE html>
<html>
<head>
	<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/css/bootstrap.min.css" integrity="sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU" crossorigin="anonymous">
	<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.min.js" integrity="sha384-skAcpIdS7UcVUC05LJ9Dxay8AXcDYfBJqt1CJ85S/CFujBsIzCIv+l9liuYLaMQ/" crossorigin="anonymous"></script>
	<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css">
	<style type="text/css">
		body {
			background-color: #fafafa;
		}
	</style>
	<script type="text/javascript">
		const getCacheStats = () => {
			const opts = { headers: { "Accept": "application/json" } };
			const queryString = window.location.search;
			fetch("/stats/z$" + queryString, opts)
				.then(response => {
					if (!response.ok) {
						throw Error(response.statusText);
					}
					return response.json();
				})
				.then(json => {
					document.getElementById("status").innerHTML = "connected"
					document.getElementById("stats").innerHTML = JSON.stringify(json, null, 4);
				})
				.catch(error => {
					document.getElementById("status").innerHTML = "disconnected"
					document.getElementById("stats").innerHTML = ""
					console.log(error);
				})
				.finally(() => {
					window.setTimeout(getCacheStats, 1000);
				});
		};
		getCacheStats();
	</script>
</head>
<body>
	<div class="container">
		<div class="row">
			<div class="text-center mt-5">
				<pre>
__________                  _________  __                           
\____    /  ____    ____   /   _____/_/  |_   ____  _______   ____  
  /     / _/ __ \  /    \  \_____  \ \   __\ /  _ \ \_  __ \_/ __ \ 
 /     /_ \  ___/ |   |  \ /        \ |  |  (  <_> ) |  | \/\  ___/ 
/_______ \ \___  >|___|  //_______  / |__|   \____/  |__|    \___  >
        \/     \/      \/         \/                             \/ 
				</pre>
				<pre id="status"/>
			</div>
		</div>
		<div class="row">
			<pre class="mb-0">Z$:</pre>
			<pre id="stats"></pre>
		</div>
	</div>
</body>
</html>
